﻿@model IEnumerable<SYTrading.Models.Glove>

@{
    ViewBag.Title = "Gloves";
}

<h2>Gloves</h2>

<p>
    @Html.ActionLink("Create New", "Create")
    @Html.ActionLink("Generate thumbnails for all glove images", "GenerateThumbnails")
    @Html.ActionLink("Clear Cache", "ClearCache")
</p>

@using (Html.BeginForm("Release", "Glove", FormMethod.Post, new { enctype = "multipart/form-data" }))
{

<table>
    <tr>
        <th>
            To release
        </th>
@*        <th>
            @Html.DisplayNameFor(model => model.Released)
        </th>*@
        <th>
            @Html.DisplayNameFor(model => model.ItemNo)
        </th>
@*        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>*@
        <th style="width: 25%;">
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Sizes)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Colors)
        </th>
@*        <th>
            @Html.DisplayNameFor(model => model.Material.Name)
        </th>*@
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            <input type="checkbox" 
                    name="ids" 
                    value="@item.GloveID"
                @(Html.Raw(item.Released ? "checked=\"checked\"" : "")) />
        </td>
@*        <td>
            @Html.DisplayFor(modelItem => item.Released)
        </td>*@
        <td>
            @if (item.Released)
            {
                <img style="vertical-align:middle;" src="~/Images/16px-Button_Icon_Green.svg.png" />
            }
            else{
                @:&nbsp;&nbsp;&nbsp;&nbsp;
            }
            @Html.DisplayFor(modelItem => item.ItemNo)
        </td>
@*        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>*@
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Sizes)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Colors)
        </td>
@*        <td>
            @Html.DisplayFor(modelItem => item.Material.Name)
        </td>*@
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.GloveID }) |
            @Html.ActionLink("Details", "Details", new { id=item.GloveID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.GloveID })
        </td>
    </tr>
}
</table>
    
<input type="submit" value="Update Released Products" />
}
